<template>
	<view class="mainbgc">
		<header-top :messageInfo="{typeFlag:true,message:title,liner:false}"></header-top>
		<view class="zdymainpadding">
			<view class="ffffff paddingbom">
				<view class="flexbetween mainpadding" v-for="item in columnsxianlu" :key="item.id">
					<view class="strongtext">{{item.name}}</view>
					<view class="rightlable radius" @click="selectxl(item.id)">选择</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				title: "",
				columnsxianlu:[]
			}
		},
		onLoad(options) {
			if (options.msg == 1) {
				this.title = "选择渠道"
			} else if (options.msg == 2) {
				this.title = "选择片区"
			} else {
				this.title = "选择线路"
			}
			this.ghexianlu()
		},
		methods: {
			// 获取线路接口
			ghexianlu() {
				httpRequest.request('appapi/manage/customer/line', 'POST', {
				}, false, false, true).then(res => {
					this.columnsxianlu=res.data
				})
			},
			selectxl(e){
				uni.$emit('getxianluid',e)
				uni.navigateBack({
					delta: 1
				});
			}
		}
	}
</script>

<style lang="scss" scoped>
	.zdymainpadding {
		padding: 30rpx 0 0 0;
	}

	.mainpadding2 {
		padding: 30rpx 30rpx 0 30rpx;
	}

	.paddingbom {
		padding-bottom: 30rpx;
	}

	.mainpadding:last-child {
		padding-bottom: 0;
	}
</style>
